<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>档案管理系统</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

    <link rel="stylesheet" href="/static/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="/static/dist/css/font-awesome.min.css">
    <link rel="stylesheet" href="/static/dist/css/ionicons.min.css">
    <link rel="stylesheet" href="/static/dist/css/AdminLTE.min.css">
    <link rel="stylesheet" href="/static/dist/css/skins/all-skins.min.css">
    <link rel="stylesheet" href="/static/css/bootstrap-treeview.css">
    <link rel="stylesheet" href="/static/css/bootstrapValidator.min.css">
    <link rel="stylesheet" href="/static/css/bootstrap-table.min.css">
    <link rel="stylesheet" href="/static/layer/theme/default/layer.css">
    <link rel="stylesheet" href="/static/css/viewer.min.css">
    <link rel="stylesheet" href="/static/css/bootstrap-table.min.css">
    <link rel="stylesheet" href="/static/webCss/wsdalr.css?v=shujubuwqd12138">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="/static/plugins/ie9/html5shiv.min.js"></script>
    <script src="/static/plugins/ie9/respond.min.js"></script>
    <![endif]-->
</head>
<body class="hold-transition skin-blue" style="font-size: medium">
<div class="content " id="yhgl">
    <div class="row">
        <div class="modal" id="daclscModal" data-backdrop="static" >
            <div class="modal-dialog" style="height: 500px;overflow: auto">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span></button>
                        <label class="modal-title" style="width: 96px;height: 22px;font-family:PingFang SC;font-size:16px;color: #333333">档案材料上传</label>
                    </div>
                    <div class="modal-body" style="height: 300px">
                        <!--<div class="row" style="margin-top: 110px;">-->
                        <!--<label class="col-xs-2">选址文件</label>-->
                        <!--<select class="form-control col-xs-2" style="width: 117px;margin-left: 10px;margin-right: 20px" v-model="dalx" id="selector">-->
                        <!--<option :value="kj">科技档案</option>-->
                        <!--<option :value="ws">文书档案</option>-->
                        <!--</select>-->
                        <!--</div>-->
                        <div class="input-group">
                            <div class="custom-file">
                                <input @change="filesChange" id="fileUpload" type="file" multiple webkitdirectory class="custom-file-input" ref="fileUpload">
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <div class="text-center">
                            <button @click.prevent="doUploadFiles" type="button" class="btn btn-primary sc"  :disabled="zzsc">上传</button>
                        </div>
                    </div>
                </div>
                <!-- /.modal-content -->
            </div>
            <!-- /.modal-dialog -->
        </div>

        <div class="modal" id="lxxzModal" data-backdrop="static" >
            <div class="modal-dialog" style="height: 500px;overflow: auto">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">选择档案类型</h4>
                    </div>
                    <div class="modal-body">
                        <div id="lxTree"></div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default pull-left" data-dismiss="modal" @click="close">关闭</button>
                        <button @click="sureLxSelect" type="button" class="btn btn-primary">确认选择</button>
                    </div>
                </div>
                <!-- /.modal-content -->
            </div>
            <!-- /.modal-dialog -->
        </div>

        <div class="modal" id="scclModel" data-backdrop="static">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">删除确认提醒</h4>
                    </div>
                    <div class="modal-body">
                        <h5>你确定要删除该材料吗？</h5>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default pull-left" data-dismiss="modal" @click="cancelcl">取消</button>
                        <button @click="sureSccl" type="button" class="btn btn-primary">确认删除</button>
                    </div>
                </div>
                <!-- /.modal-content -->
            </div>
            <!-- /.modal-dialog -->
        </div>
    </div>
    <div id="tree2">
        <img id="tree2Img" dataUrl="http://211.159.186.65:33333/api/fj/downloadFj?type=1&fileName=1590982068983.jpg">
    </div>
    <div class="row" v-show="daShow">
        <div class="col-xs-3 left">
            <div class="row" style="height: 54px;border-bottom: 1px solid #E0E0E0">
                <label class="col-xs-4" style="color: #3A3A3A;font-weight: 600;padding-top: 17px;font-size: 16px">档案材料</label>
                <div class="btn-group col-xs-offset-3" style="padding-top: 17px;">
                    <a class="btn btn-primary" style="background-color: #2C75E8;width: 64px;height: 25px;border-radius:2px 0px 0px 2px;padding: 2px;" @click="upload">上传</a>
                    <a class="btn btn-default" style="width: 64px;height: 25px;color: #888888;border-radius:2px;padding: 2px;" @click="refreshda">刷新</a>
                </div>
            </div>
            <div class="" style="height: 700px;overflow: auto">
                <div id="tree"></div>
            </div>
        </div>
        <div class="col-xs-9 right">
            <div class="row" style="border-bottom: 1px solid #E0E0E0">
                <div class="col-xs-2">
                    <label class="lrtabs" style="color: #3A3A3A;font-weight: 600;padding-top: 17px;font-size: 16px" @click="daxxlr" id="daxxtab">档案信息录入</label>
                </div>
                <div class="col-xs-2">
                    <label style="color: #3A3A3A;font-weight: 600;padding-top: 17px;font-size: 16px" @click="clxxlr" id="clxxtab">材料信息录入</label>
                </div>
                <div class="col-xs-2 col-xs-offset-5" style="padding-top: 1.4%;padding-left: 22%;">
                    <button class="btn btn-primary" style="float: right;height: 25px;width:111px;border-radius: 2px;background-color: #2C75E8;padding-top: 2px;font-family: 'PingFang SC'" @click="goback">返回</button>
                </div>
            </div>
            <form role="form" id="wsxxForm">
                <div v-show="da">
                    <div class="row">
                        <div class="form-group col-xs-6">
                            <label>档案编号*</label>
                            <input  @change="wsdabhChange" name="dabh" v-model="wsxx.dabh" type="text"
                                   class="form-control input-sm" :readonly="readOnlyDabh">
                        </div>
                        <div class="form-group col-xs-3">
                            <label>时间</label>
                            <input v-model="wsxx.sj" name="sj" type="text"
                                   class="form-control input-sm">
                        </div>
                        <div class="form-group col-xs-3">
                            <label>文号</label>
                            <input v-model="wsxx.wh" name="wh" type="text"
                                   class="form-control input-sm">
                        </div>
                        <div class="form-group col-xs-12">
                            <label>案卷题名*</label>
                            <input v-model="wsxx.wjmc" name="wjmc" type="text"
                                   class="form-control input-sm">
                        </div>
                        <div class="form-group col-xs-12">
                            <label>单位名称</label>
                            <input v-model="wsxx.dwmc" name="dwmc" type="text"
                                   class="form-control input-sm">
                        </div>
                        <div class="form-group col-xs-6">
                            <label>登记人</label>
                            <input v-model="wsxx.djr" name="djr" type="text" readonly
                                   class="form-control input-sm">
                        </div>
                        <div class="form-group col-xs-6">
                            <label>登记时间</label>
                            <input v-model="wsxx.inputtime" name="inputtime" type="text" readonly
                                   class="form-control input-sm">
                        </div>
                        <div class="form-group col-xs-3">
                            <label>年份*</label>
                            <input v-model="wsxx.nf" name="nf" type="text"
                                   class="form-control input-sm">
                        </div>
                        <div class="form-group col-xs-3">
                            <label>页数</label>
                            <input v-model="wsxx.ys" name="ys" type="text"
                                   class="form-control input-sm">
                        </div>
                        <div class="form-group col-xs-3">
                            <label>总盒号</label>
                            <input v-model="wsxx.zhh" name="zhh" type="text"
                                   class="form-control input-sm">
                        </div>
                        <div class="form-group col-xs-3">
                            <label>页号</label>
                            <input v-model="wsxx.yh" name="yh" type="text"
                                   class="form-control input-sm">
                        </div>
                        <div class="form-group col-xs-12">
                            <label>备注</label>
                            <textarea v-model="wsxx.bz" name="qzh" type="text" class="form-control input-sm"></textarea>
                        </div>
                    </div>
                    <div class="row">
                        <div class="text-center" style="margin-top: 10%">
                            <a class="btn btn-primary save" @click.prevent="mySubmitws" :disabled="zzmySubmit">保存</a>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>

    <div class="row" v-show="clShow">
        <div class="col-xs-6 clLeft">
            <div class="row" style="height: 54px;border-bottom: 1px solid #E0E0E0">
                <div class="col-xs-3">
                    <label class="lrtabs" style="color: #3A3A3A;font-weight: 600;padding-top: 17px;font-size: 16px" @click="daxxlr" id="daxxtab2">档案信息录入</label>
                </div>
                <div class="col-xs-3">
                    <label style="color: #3A3A3A;font-weight: 600;padding-top: 17px;font-size: 16px" @click="clxxlr" id="clxxtab2">材料信息录入</label>
                </div>
                <div class="col-xs-2 col-xs-offset-4" style="padding-top: 14px">
                    <button class="btn btn-primary" style="float: right;height: 25px;width:111px;border-radius: 2px;background-color: #2C75E8;padding-top: 2px;font-family: 'PingFang SC'" @click="goback">返回</button>
                </div>
            </div>
            <form role="form" id="clxxForm">
                <div>
                    <div class="row" style="height: 653px">
                        <div class="nav-tabs-custom">
                            <!-- Tabs within a box -->
                            <ul class="nav nav-tabs pull-right">
                                <li class="pull-left"><i class="fa fa-inbox"></i> 基本信息</li>
                                <div class="btn-group col-xs-offset-6 row" style="padding-top: 17px;">
                                    <div v-show="isSave">
                                        <a class="btn btn-primary" style="background-color: #ffffff;color: #2C75E8;width: 64px;height: 25px;border-radius:2px 0px 0px 2px;padding: 2px;margin-left: 305px;margin-top: -60px;"@click.prevent="mySubmit2" :disabled="zzmySubmit2">保存</a>
                                    </div>
                                    <div v-show="!isSave" style="margin-top: 26px;">
                                        <a class="btn btn-primary col-xs-6" style="background-color: #ffffff;color: #2C75E8;width: 64px;height: 25px;border-radius:2px 0px 0px 2px;padding: 2px;margin-left: 221px;margin-top: -60px;"@click.prevent="mySubmit2"  :disabled="zzmySubmit2">更新</a>
                                        <a class="btn btn-primary col-xs-6" style="background-color: #ffffff;color: #2C75E8;width: 64px;height: 25px;border-radius:2px 0px 0px 2px;padding: 2px;margin-left: 300px;margin-top: -60px;"@click.prevent="insert"  :disabled="zzmySubmit2">插入</a>
                                    </div>
                                </div>
                            </ul>
                            <div class="tab-content no-padding">
                                <!-- Morris chart - Sales -->
                                <div class="chart tab-pane active" style="position: relative">
                                    <div class="row">
                                        <div class="form-group col-xs-6">
                                            <label>*档案类型</label>
                                            <input type="text" class="form-control input-sm" v-model="dalxText" readonly>
                                        </div>
                                        <div class="form-group col-xs-6">
                                            <label>*档案编号</label>
                                            <input @change="cldabhChange" name="dabh" v-model="clxx.dabh" type="text" class="form-control input-sm" :readonly="readOnlyDabh">
                                        </div>
                                        <div class="form-group col-xs-6">
                                            <label>*文件序号</label>
                                            <input name="wjxh" v-model="clxx.wjxh" type="text" class="form-control input-sm">
                                        </div>
                                        <div class="form-group col-xs-6">
                                            <label>页数</label>
                                            <input name="ys" v-model="clxx.ys" type="text" class="form-control input-sm">
                                        </div>
                                        <div class="form-group col-xs-12">
                                            <label>*材料名称</label>
                                            <textarea name="clmc" v-model="clxx.clmc" type="text" class="form-control input-sm" style="height: 64px"></textarea>
                                        </div>
                                        <div class="form-group col-xs-6">
                                            <label>起始页码</label>
                                            <input name="qsym" v-model="clxx.qsym" type="text" class="form-control input-sm">
                                        </div>
                                        <div class="form-group col-xs-6">
                                            <label>终止页码</label>
                                            <input name="zzym" v-model="clxx.zzym" type="text" class="form-control input-sm">
                                        </div>
                                    </div>
                                </div>
                                <!--<div class="chart tab-pane" id="sales-chart" style="position: relative; height: 300px;"></div>-->
                            </div>
                        </div>
                        <div class="nav-tabs-custom">
                            <!-- Tabs within a box -->
                            <ul class="nav nav-tabs pull-right">
                                <li class="pull-left"><i class="fa fa-inbox"></i> 其他</li>
                            </ul>
                            <div class="tab-content no-padding">
                                <!-- Morris chart - Sales -->
                                <div class="chart tab-pane active" style="position: relative">
                                    <div class="row">
                                        <div class="form-group col-xs-6">
                                            <label>份数</label>
                                            <input name="fs" v-model="clxx.fs" type="text" class="form-control input-sm">
                                        </div>
                                        <div class="form-group col-xs-6">
                                            <label>年份</label>
                                            <input name="year" v-model="clxx.year" type="text" class="form-control input-sm">
                                        </div>
                                        <div class="form-group col-xs-6">
                                            <label>案卷号/文号/许可证号</label>
                                            <input name="otherZh" v-model="clxx.otherZh" type="text" class="form-control input-sm">
                                        </div>
                                        <div class="form-group col-xs-6">
                                            <label>受理时间</label>
                                            <input name="slsj" v-model="clxx.slsj" type="text" class="form-control input-sm">
                                        </div>
                                        <div class="form-group col-xs-12">
                                            <label>备注</label>
                                            <textarea class="form-control" v-model="clxx.bz" name="bz"></textarea>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
        <div class="col-xs-6 clRight">
            <div class="row" style="height: 54px;border-bottom: 1px solid #E0E0E0">
                <label class="col-xs-2" style="color: #3A3A3A;font-weight: 600;padding-top: 17px;font-size: 16px">材料基本信息</label>
                <a class="col-xs-offset-7 col-xs-1 btn btn-primary output" @click="dccl">导出</a>
                <a class="col-xs-offset-1 col-xs-1 btn btn-primary output" @click="upload">上传</a>
            </div>
            <div class="" style="height: 700px;overflow: auto">
                <table class="table table-bordered table-hover text-center" id="clTable" style="table-layout: fixed;">

                </table>
            </div>
        </div>
    </div>

</div>

<script src="/static/plugins/jQuery/jquery-2.2.3.min.js"></script>
<!-- Bootstrap 3.3.6 -->
<script src="/static/bootstrap/js/bootstrap.min.js"></script>
<!-- Slimscroll -->
<script src="/static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="/static/plugins/fastclick/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="/static/dist/js/app.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="/static/dist/js/demo.js"></script>
<!--tabs-->
<script src="/static/dist/js/app_iframe.js"></script>
<script src="/static/js/bootstrap-treeview.js"></script>
<script src="/static/js/bootstrapValidator.min.js"></script>
<script src="/static/js/bootstrap-table.min.js"></script>
<script src="/static/js/bootstrap-table-zh-CN.js"></script>
<script src="/static/js/vue.js"></script>
<script src="/static/js/vue-resource.min.js"></script>
<script src="/static/layer/layer.js"></script>
<script src="/static/js/myJs.js?v=shujubuwqd12138"></script>
<script src="/static/js/viewer.min.js"></script>
<script src="/static/dist/js/pages/wJs.js?v=shujubuwqd12138"></script>
<script src="/static/js/newJs.js?v=shujubuwqd12138"></script>

<script type="text/javascript">
    newCss("/static/webCss/wsdalr.css");
    var pageNum;
    var pageSize;
    var typeId;
    var id;
    var viewer2;
    //键盘按下
    var kdLxNodes;
    var kdid;
    var kdId;
    var kdtreeNum;
    function paramsMatter(value,row,index) {
        var span=document.createElement('span');
        span.setAttribute('title',value);
        span.innerHTML = value;
        return span.outerHTML;
    }
    var nextid;
    var preid;
    var Id = 0;
    var ids = new Array();
    //记录节点id；
    var nodeId;
    var nodeId2;
    //记录节点的个数
    var index;
    var nodeCheckedSilent = false;

    function nodeChecked(event, node) {
        if (nodeCheckedSilent) {
            return;
        }
        nodeCheckedSilent = true;
        checkAllParent(node);
        checkAllSon(node);
        nodeCheckedSilent = false;
    }

    var nodeUncheckedSilent = false;

    function nodeUnchecked(event, node) {
        if (nodeUncheckedSilent)
            return;
        nodeUncheckedSilent = true;
        uncheckAllParent(node);
        uncheckAllSon(node);
        nodeUncheckedSilent = false;
    }

    //选中全部父节点
    function checkAllParent(node) {
        $('#tree').treeview('checkNode', node.nodeId, {
            silent: true
        });
        var parentNode = $('#tree').treeview('getParent', node.nodeId);
        if (!("nodeId" in parentNode)) {
            return;
        } else {
            checkAllParent(parentNode);
        }
    }
    //取消全部父节点
    function uncheckAllParent(node) {
        $('#tree').treeview('uncheckNode', node.nodeId, {
            silent: true
        });
        var siblings = $('#tree').treeview('getSiblings', node.nodeId);
        var parentNode = $('#tree').treeview('getParent', node.nodeId);
        if (!("nodeId" in parentNode)) {
            return;
        }
        var isAllUnchecked = true; //是否全部没选中
        for (var i in siblings) {
            if (siblings[i].state.checked) {
                isAllUnchecked = false;
                break;
            }
        }
        if (isAllUnchecked) {
            uncheckAllParent(parentNode);
        }

    }

    //级联选中所有子节点
    function checkAllSon(node) {
        $('#tree').treeview('checkNode', node.nodeId, {
            silent: true
        });
        if (node.nodes != null && node.nodes.length > 0) {
            for (var i in node.nodes) {
                checkAllSon(node.nodes[i]);
            }
        }
    }
    //级联取消所有子节点
    function uncheckAllSon(node) {
        $('#tree').treeview('uncheckNode', node.nodeId, {
            silent: true
        });
        if (node.nodes != null && node.nodes.length > 0) {
            for (var i in node.nodes) {
                uncheckAllSon(node.nodes[i]);
            }
        }
    }



    var nodeCheckedSilent2 = false;

    function nodeChecked2(event, node) {
        if (nodeCheckedSilent2) {
            return;
        }
        nodeCheckedSilent2 = true;
        checkAllParent2(node);
        checkAllSon2(node);
        nodeCheckedSilent2 = false;
    }

    var nodeUncheckedSilent2 = false;

    function nodeUnchecked2(event, node) {
        if (nodeUncheckedSilent2)
            return;
        nodeUncheckedSilent2 = true;
        uncheckAllParent2(node);
        uncheckAllSon2(node);
        nodeUncheckedSilent2 = false;
    }

    //选中全部父节点
    function checkAllParent2(node) {
        $('#tree5').treeview('checkNode', node.nodeId, {
            silent: true
        });
        var parentNode = $('#tree5').treeview('getParent', node.nodeId);
        if (!("nodeId" in parentNode)) {
            return;
        } else {
            checkAllParent2(parentNode);
        }
    }
    //取消全部父节点
    function uncheckAllParent2(node) {
        $('#tree5').treeview('uncheckNode', node.nodeId, {
            silent: true
        });
        var siblings = $('#tree5').treeview('getSiblings', node.nodeId);
        var parentNode = $('#tree5').treeview('getParent', node.nodeId);
        if (!("nodeId" in parentNode)) {
            return;
        }
        var isAllUnchecked2 = true; //是否全部没选中
        for (var i in siblings) {
            if (siblings[i].state.checked) {
                isAllUnchecked2 = false;
                break;
            }
        }
        if (isAllUnchecked2) {
            uncheckAllParent2(parentNode);
        }

    }

    //级联选中所有子节点
    function checkAllSon2(node) {
        $('#tree5').treeview('checkNode', node.nodeId, {
            silent: true
        });
        if (node.nodes != null && node.nodes.length > 0) {
            for (var i in node.nodes) {
                checkAllSon2(node.nodes[i]);
            }
        }
    }
    //级联取消所有子节点
    function uncheckAllSon2(node) {
        $('#tree5').treeview('uncheckNode', node.nodeId, {
            silent: true
        });
        if (node.nodes != null && node.nodes.length > 0) {
            for (var i in node.nodes) {
                uncheckAllSon2(node.nodes[i]);
            }
        }
    }
    //打开上一张图片
    /*
    nowId为选择的节点id,
    ids为图片数组
    Id为借阅id
    treeNum分辨哪个treeview
     */
    function openpre(lxNodes,id,Id,treeNum) {
        preid = id;
        var upanddownImgVo = {
            'id':id,
            'type':0,
            'lxNodes':lxNodes,
        };
        $.ajax({
            url: '/jy/api/upanddownImg',
            type: 'post',
            dataType:'JSON',
            data: JSON.stringify(upanddownImgVo),
            cache: false,
            contentType: 'application/json; charset=UTF-8',
            processData: false,
            //dataType: "json",
            async: false,
            success: function (result) {
                if(result.code == 200){
                    var id = result.data;
                    preid = id;
                    kdid = id;
                    if(treeNum == 3){
                        $('#tree3Img').attr('dataUrl', '/jy/api/getImg?path='+id+'&jyId='+Id);
                        var viewer = new Viewer(document.getElementById('tree3'), {
                            inline: true,
                            url: 'dataUrl',
                            //navbar: false,
                            zIndexInline: 9999,
                            button: true,
                            backdrop: true,
                            keyboard:true,
                            navbar:false,
                            toolbar: {
                                zoomIn: {
                                    show: 1,
                                    click: function () {
                                        viewer.destroy();
                                    }
                                },
                                zoomOut: 0,
                                oneToOne: 0,
                                reset: 0,
                                prev: {
                                    show:1,
                                    click:function(){
                                        viewer.destroy();
                                        openpre(lxNodes,id,Id,3);
                                    }

                                },
                                next: {
                                    show:1,
                                    click:function(){
                                        viewer.destroy();
                                        opennext(lxNodes,id,Id,3)
                                    }
                                },
                                rotateLeft: 1,
                                rotateRight: 1,
                                flipHorizontal: 0,
                                flipVertical: 0,
                            },
                        });
                    }else if(treeNum == 2){
                        $('#tree2Img').attr('dataUrl', '/jy/api/getImg?path='+id+'&jyId='+Id);
                        viewer2 = new Viewer(document.getElementById('tree2'), {
                            inline: true,
                            url: 'dataUrl',
                            //navbar: false,
                            zIndexInline: 9999,
                            button: true,
                            backdrop: true,
                            keyboard:true,
                            navbar:false,
                            toolbar: {
                                zoomIn: {
                                    show: 1,
                                    click: function () {
                                        viewer2.destroy();
                                    }
                                },
                                zoomOut: 0,
                                oneToOne: 0,
                                reset: 0,
                                prev: {
                                    click:function(){
                                        viewer2.destroy();
                                        openpre(lxNodes,id,Id,2);
                                    }
                                },
                                next: {
                                    show:1,
                                    click:function(){
                                        viewer2.destroy();
                                        opennext(lxNodes,id,Id,2)
                                    }
                                },
                                rotateLeft: 1,
                                rotateRight: 1,
                                flipHorizontal: 0,
                                flipVertical: 0,
                            },
                        });
                    }
                }else {
                    cxAlertts("已经是第一张");
                    if(treeNum == 3){
                        $('#tree3Img').attr('dataUrl', '/jy/api/getImg?path='+preid+'&jyId='+Id);
                        var viewer = new Viewer(document.getElementById('tree3'), {
                            inline: true,
                            url: 'dataUrl',
                            //navbar: false,
                            zIndexInline: 9999,
                            button: true,
                            backdrop: true,
                            keyboard:true,
                            navbar:false,
                            toolbar: {
                                zoomIn: {
                                    show: 1,
                                    click: function () {
                                        viewer.destroy();
                                    }
                                },
                                zoomOut: 0,
                                oneToOne: 0,
                                reset: 0,
                                prev: {
                                    show:1,
                                    click:function(){
                                        viewer.destroy();
                                        openpre(lxNodes,preid,Id,3);
                                    }

                                },
                                next: {
                                    show:1,
                                    click:function(){
                                        viewer.destroy();
                                        opennext(lxNodes,preid,Id,3)
                                    }
                                },
                                rotateLeft: 1,
                                rotateRight: 1,
                                flipHorizontal: 0,
                                flipVertical: 0,
                            },
                        });
                    }else if(treeNum == 2){
                        $('#tree2Img').attr('dataUrl', '/jy/api/getImg?path='+preid+'&jyId='+Id);
                        viewer2 = new Viewer(document.getElementById('tree2'), {
                            inline: true,
                            url: 'dataUrl',
                            //navbar: false,
                            zIndexInline: 9999,
                            button: true,
                            backdrop: true,
                            keyboard:true,
                            navbar:false,
                            toolbar: {
                                zoomIn: {
                                    show: 1,
                                    click: function () {
                                        viewer2.destroy();
                                    }
                                },
                                zoomOut: 0,
                                oneToOne: 0,
                                reset: 0,
                                prev: {
                                    click:function(){
                                        viewer2.destroy();
                                        openpre(lxNodes,preid,Id,2);
                                    }
                                },
                                next: {
                                    show:1,
                                    click:function(){
                                        viewer2.destroy();
                                        opennext(lxNodes,preid,Id,2)
                                    }
                                },
                                rotateLeft: 1,
                                rotateRight: 1,
                                flipHorizontal: 0,
                                flipVertical: 0,
                            },
                        });
                    }
                }
            }
        });
    }
    //打开下一张
    function opennext(lxNodes,id,Id,treeNum) {
        nextid = id;
        var upanddownImgVo = {
            'id':id,
            'type':1,
            'lxNodes':lxNodes,
        };
        $.ajax({
            url: '/jy/api/upanddownImg',
            type: 'post',
            dataType:'JSON',
            data: JSON.stringify(upanddownImgVo),
            cache: false,
            contentType: 'application/json; charset=UTF-8',
            processData: false,
            //dataType: "json",
            async: false,
            success: function (result) {
                if(result.code == 200){
                    var id = result.data;
                    nextid = id;
                    kdid = id;
                    if(treeNum == 3){
                        $('#tree3Img').attr('dataUrl', '/jy/api/getImg?path='+id+'&jyId='+Id);
                        var viewer = new Viewer(document.getElementById('tree3'), {
                            inline: true,
                            url: 'dataUrl',
                            //navbar: false,
                            zIndexInline: 9999,
                            button: true,
                            backdrop: true,
                            keyboard:true,
                            navbar:false,
                            toolbar: {
                                zoomIn: {
                                    show: 1,
                                    click: function () {
                                        viewer.destroy();
                                    }
                                },
                                zoomOut: 0,
                                oneToOne: 0,
                                reset: 0,
                                prev: {
                                    show:1,
                                    click:function(){
                                        viewer.destroy();
                                        openpre(lxNodes,id,Id,3);
                                    }

                                },
                                next: {
                                    show:1,
                                    click:function(){
                                        viewer.destroy();
                                        opennext(lxNodes,id,Id,3)
                                    }
                                },
                                rotateLeft: 1,
                                rotateRight: 1,
                                flipHorizontal: 0,
                                flipVertical: 0,
                            },
                        });
                    }else if(treeNum == 2){
                        $('#tree2Img').attr('dataUrl', '/jy/api/getImg?path='+id+'&jyId='+Id);
                        viewer2 = new Viewer(document.getElementById('tree2'), {
                            inline: true,
                            url: 'dataUrl',
                            //navbar: false,
                            zIndexInline: 9999,
                            button: true,
                            backdrop: true,
                            keyboard:true,
                            navbar:false,
                            toolbar: {
                                zoomIn: {
                                    show: 1,
                                    click: function () {
                                        viewer2.destroy();
                                    }
                                },
                                zoomOut: 0,
                                oneToOne: 0,
                                reset: 0,
                                prev: {
                                    click:function(){
                                        viewer2.destroy();
                                        openpre(lxNodes,id,Id,2);
                                    }
                                },
                                next: {
                                    show:1,
                                    click:function(){
                                        viewer2.destroy();
                                        opennext(lxNodes,id,Id,2)
                                    }
                                },
                                rotateLeft: 1,
                                rotateRight: 1,
                                flipHorizontal: 0,
                                flipVertical: 0,
                            },
                        });
                    }
                }else {
                    cxAlertts("已经是最后一张");
                    if(treeNum == 3){
                        $('#tree3Img').attr('dataUrl', '/jy/api/getImg?path='+nextid+'&jyId='+Id);
                        var viewer = new Viewer(document.getElementById('tree3'), {
                            inline: true,
                            url: 'dataUrl',
                            //navbar: false,
                            zIndexInline: 9999,
                            button: true,
                            backdrop: true,
                            keyboard:true,
                            navbar:false,
                            toolbar: {
                                zoomIn: {
                                    show: 1,
                                    click: function () {
                                        viewer.destroy();
                                    }
                                },
                                zoomOut: 0,
                                oneToOne: 0,
                                reset: 0,
                                prev: {
                                    show:1,
                                    click:function(){
                                        viewer.destroy();
                                        openpre(lxNodes,nextid,Id,3);
                                    }

                                },
                                next: {
                                    show:1,
                                    click:function(){
                                        viewer.destroy();
                                        opennext(lxNodes,nextid,Id,3)
                                    }
                                },
                                rotateLeft: 1,
                                rotateRight: 1,
                                flipHorizontal: 0,
                                flipVertical: 0,
                            },
                        });
                    }else if(treeNum == 2){
                        $('#tree2Img').attr('dataUrl', '/jy/api/getImg?path='+nextid+'&jyId='+Id);
                        viewer2 = new Viewer(document.getElementById('tree2'), {
                            inline: true,
                            url: 'dataUrl',
                            //navbar: false,
                            zIndexInline: 9999,
                            button: true,
                            backdrop: true,
                            keyboard:true,
                            navbar:false,
                            toolbar: {
                                zoomIn: {
                                    show: 1,
                                    click: function () {
                                        viewer2.destroy();
                                    }
                                },
                                zoomOut: 0,
                                oneToOne: 0,
                                reset: 0,
                                prev: {
                                    click:function(){
                                        viewer2.destroy();
                                        openpre(lxNodes,nextid,Id,2);
                                    }
                                },
                                next: {
                                    show:1,
                                    click:function(){
                                        viewer2.destroy();
                                        opennext(lxNodes,nextid,Id,2)
                                    }
                                },
                                rotateLeft: 1,
                                rotateRight: 1,
                                flipHorizontal: 0,
                                flipVertical: 0,
                            },
                        });
                    }
                }
            }
        });
    }

    function sccl(id) {
        scid = id;
        $('#scclModel').modal('show');
    }
    //编辑材料
    function edit(dabh,id) {
        vue.$data.isSave = false;
        $.get('/dalr/api/queryDabhClxx?dabh='+dabh,function (res) {
            var data = res.data;
            if(res.code == 200){
                for(var i = 0;i < data.length;i++){
                    if(data[i].id == id){
                        vue.$data.clxx = data[i];
                        break;
                    }
                }
            }else{
                cxAlert(res.mess);
            }
        })
    }
    var vue = new Vue({
        el: '#yhgl',
        data: {
            readOnlyDabh:false,
            isRefresh:false,
            isSave:true,
            zzmySubmit2:false,
            zzsc:false,
            upLoadFiles:null,
            files:null,
            scsmyj:{
                yjmc:null,
            },
            dalxText:null,
            daShow:true,
            clShow:false,
            zzsc:false,
            zzmySubmit:false,
            kj:null,
            ws:null,
            dalx:null,
            zzmySubmitws:false,
            clButton:true,
            daButton:false,
            cl:false,
            da:true,
            allShy:null,
            role:null,
            keyword:null,
            wsxx:{
                djr:null,
                inputtime:null,
                bz:null,
                jyId:null,
                //files:[],
                id:null,
                typeId:null,
                dabh:null,//档案编号
                dwmc:null,//单位名称
                nf:null,//年份
                sj:null,//时间
                typeName:null,
                wh:null,//文号
                wjmc:null,//文件名称
                yh:null,//页号
                ys:null,//页数
                zhh:null,//总盒号
            },
            jyxx2:{
                clxxIds:[],
                jyyy:null,
                jysx:5,
                dabh:null,
                jyrLxdh:null,
                jyr:null,
                shrLxdh:null,
                shrId:null,
                shr:null,
                damc:null,
                dalx:null,
            },
            clxx:{
                id:null,
                slsj:null,
                typeName:null,
                clmc:null,
                otherZh:null,
                dabh:null,
                typeId:null,
                wjxh:"001",
                //clmc:null,
                fs:null,
                qsym:null,
                zzym:null,
                ys:null,
                year:null,
                otherZh:null,
                bz:null
            }
        },
        methods: {
            goback:function(){
                if(pageNum === undefined || pageNum === ''){
                    top.addTabs({
                        id: "90023",
                        text: "档案信息补录",
                        icon: "fa fa-circle-o",
                        url: "daxxbl",
                        targetType: "iframe-tab",
                        close:true
                    });
                }else {
                    top.addTabs({
                        id: "90023",
                        text: "档案信息补录",
                        icon: "fa fa-circle-o",
                        url: "daxxbl?pageNum="+pageNum+"&pageSize="+pageSize,
                        targetType: "iframe-tab",
                        close:true
                    });
                }

            },
            insert:function(){
                this.clxx.id = null;
                this.isSave = true;
            },
            doUploadFiles:function(){
                dabh = this.clxx.dabh;
                dalx = this.dalxText;
                this.clxx.typeName = dalx;
                this.clxx.typeId = typeId;
                if(this.dalxText == null || this.clxx.dabh == null){
                    cxAlert("请先将档案类型和档案编号填写完整");
                    return;
                }
                if(this.files == null || this.files.length==0){
                    cxAlert("请选择要上传的文件夹");
                    return;
                }
                var data = new FormData();
                data.append('lb',this.dalxText);
                data.append('dah', this.clxx.dabh);
                for (var i = 0; i < this.files.length; i++) {
                    data.append('files', this.files[i])
                }
                //$('#shangchuan').modal('show');
                this.zzsc = false;
                this.$http.post('/api/upload/upLoadClxx', data, {
                    headers: {
                        'Content-Type': 'multipart/form-data',
                    },
                }).then(res => {
                    this.zzsc = true;
                    var data = res.body;
                    if(data.code == "200"){
                        this.refreshda();
                        this.zzsc = false;
                        typeName = this.clxx.typeName;
                        typeId = this.clxx.typeId;
                        cxAlertOk("文件夹上传成功");
                        $('#daclscModal').modal('hide');
                        $("form").data('bootstrapValidator').resetForm();//清除当前验证的关键之处
                        Object.keys(this.clxx).forEach(key => (this.clxx[key] = null));
                        this.parentLx=null;
                        //this.dalx=null;
                        //this.dalxText = null;
                        this.clxx.dabh = dabh;
                        this.clxx.typeName = typeName;
                        this.clxx.typeId = typeId;
                        $("#clTable").bootstrapTable('destroy');
                        $('#clTable').bootstrapTable({
                            url: '/dalr/api/queryDabhClxx?dabh='+this.clxx.dabh,
                            contentType: "application/json; charset=UTF-8",
                            type: "GET",
                            dataType: 'json',
                            queryParamsType: "",
                            singleSelect: true,
                            paginationShowPageGo: true,
                            pageNumber:1,
                            pageSize:8,
                            queryParams: function (params) {
                                return {'pageNum':params.pageNumber,'pageSize':params.pageSize};
                            },
                            striped: true,
                            smartDisplay:false,
                            cache: false,
                            pagination: false,
                            pageList: [8],
                            sidePagination: 'server',
                            toolbar: "#addtool",
                            columns: [
                                {
                                    title: '文件序号',
                                    field:'wjxh',
                                    formatter:paramsMatter
                                },{
                                    field: 'clmc',
                                    title: '材料名称',
                                    formatter:paramsMatter
                                },
                                {
                                    title: '起始页码',
                                    field:'qsym',
                                    formatter:paramsMatter
                                },{
                                    field: 'zzym',
                                    title: '终止页码',
                                    formatter:paramsMatter
                                },{
                                    field: 'ys',
                                    title: '页数',
                                    formatter:paramsMatter
                                },{
                                    title: '操作',
                                    formatter: function (value, row, index) {
                                        var aStr = '<a class="czBtn" href="javascript:edit(\''+row.dabh+'\','+row.id+')">编辑</a>';
                                        aStr += '<a class="czBtn" href="javascript:sccl('+row.id+')">删除</a>';
                                        return aStr;
                                    }
                                }
                            ],
                            responseHandler: function (res) {  //后台返回的结果
                                if (res.code == "200") {
                                    var data = res.data;
                                    var NewData = [];
                                    for(i=0;i<data.length;i++){
                                        var dd = data[i];
                                        NewData.push(dd);
                                    }
                                    var data = {
                                        total: res.data.total,
                                        rows: NewData
                                    };
                                    return data;
                                }
                            }
                        });
                    }else{
                        this.zzsc = false;
                        cxAlert(data.mess);
                    }

                }).catch(err => {
                    this.zzsc = false;
                    console.log(err);
                });
            },
            filesChange:function(){
                this.upLoadFiles = [];
                this.files = [];
                this.scsmyj.yjmc=[];
                var temp = [];
                this.upLoadFiles = [];
                var fileUpload = this.$refs.fileUpload;
                var file = fileUpload.files;
                var tempFile=[];
                for(i = 0; i < file.length; i++){
                    var f = file[i];
                    tempFile.push(f);
                    // if(f.name.toLowerCase().indexOf(".jpg") != -1 || f.name.toLowerCase().indexOf(".png") != -1 || f.name.toLowerCase().indexOf(".bmp") != -1 || f.name.toLowerCase().indexOf(".pdf") != -1){
                    //
                    // }
                }
                this.files = tempFile;
                //this.gdxx.zys = tempFile.length;
                for (i = 0; i < tempFile.length; i++) {
                    var f = tempFile[i];
                    var path = f.webkitRelativePath;
                    data={};
                    data['id']=i+1;
                    var lastPath = path.lastIndexOf("/");
                    var lastPath2= path.substring(0,lastPath).lastIndexOf("/");
                    if(lastPath2){
                        data['yjmc'] = path.substring(lastPath2+1,lastPath);
                        temp.push(path.substring(lastPath2+1,lastPath));
                    }else {
                        temp.push(path.substring(0,path.lastIndexOf("/")));
                    }
                    //this.clxx.dabh = path.substring(0,path.indexOf("/"));
                    data['wjmc'] = f.name;
                    this.upLoadFiles.push(data);
                    this.scsmyj.yjmc = data['yjmc'];
                }
                this.scsmyj.yjmc = temp;
                //this.doUploadFiles();
            },
            //确认删除材料
            sureSccl:function(){
                $.get("/dalr/api/deletecl?id=" + scid, function (result) {
                    if (result.code == 200) {
                        cxAlertOk("删除成功");
                        $('#scclModel').modal('hide');
                        $("#clTable").bootstrapTable('destroy');
                        $('#clTable').bootstrapTable({
                            url: '/dalr/api/queryDabhClxx?dabh='+vue.$data.clxx.dabh,
                            contentType: "application/json; charset=UTF-8",
                            type: "GET",
                            dataType: 'json',
                            queryParamsType: "",
                            singleSelect: true,
                            paginationShowPageGo: true,
                            pageNumber:1,
                            pageSize:8,
                            queryParams: function (params) {
                                return {'pageNum':params.pageNumber,'pageSize':params.pageSize};
                            },
                            striped: true,
                            smartDisplay:false,
                            cache: false,
                            pagination: false,
                            pageList: [8],
                            sidePagination: 'server',
                            toolbar: "#addtool",
                            columns: [
                                {
                                    title: '文件序号',
                                    field:'wjxh',
                                    formatter:paramsMatter
                                },{
                                    field: 'clmc',
                                    title: '材料名称',
                                    formatter:paramsMatter
                                },
                                {
                                    title: '起始页码',
                                    field:'qsym',
                                    formatter:paramsMatter
                                },{
                                    field: 'zzym',
                                    title: '终止页码',
                                    formatter:paramsMatter
                                },{
                                    field: 'ys',
                                    title: '页数',
                                    formatter:paramsMatter
                                },{
                                    title: '操作',
                                    formatter: function (value, row, index) {
                                        var aStr = '<a class="czBtn" href="javascript:edit(\''+row.dabh+'\','+row.id+')">编辑</a>';
                                        aStr += '<a class="czBtn" href="javascript:sccl('+row.id+')">删除</a>';
                                        return aStr;
                                    }
                                }
                            ],
                            responseHandler: function (res) {  //后台返回的结果
                                if (res.code == "200") {
                                    var data = res.data;
                                    var NewData = [];
                                    for(i=0;i<data.length;i++){
                                        var dd = data[i];
                                        NewData.push(dd);
                                    }
                                    var data = {
                                        total: res.data.total,
                                        rows: NewData
                                    };
                                    return data;
                                }
                            }
                        });
                    }
                });
            },
            //取消删除材料
            cancelcl:function(){
                $('#scclModel').modal('hide');
            },
            dabhChange:function(){
                 this.clxx.dabh = this.wsxx.dabh;
                var bh = this.wsxx.dabh;
                var datas = bh.split("-");
                var code = datas[0];
                code = datas[0].substring(0,code.length-4)
                this.$http.get('/dagl/api/queryCode?code='+code).then( function (result) {
                    var data = result.body;
                    if (data.code == 200) {
                        if(data.data.sfws != 3){
                            cxAlert("请输入文书档案编号");
                            $("form").data('bootstrapValidator').resetForm();//清除当前验证的关键之处
                        }else {
                            this.parentLx = data.data.id;
                            this.dalx = data.data.id;
                            this.dalxText = data.data.dalxName;
                            this.clxx.typeId = data.data.id;
                            typeId = this.clxx.typeId;
                            this.clxx.typeName = data.data.dalxName;
                            this.wsxx.typeName = data.data.dalxName;
                        }
                    }else{

                    }
                });

                $("#clTable").bootstrapTable('destroy');
                $('#clTable').bootstrapTable({
                    url: '/dalr/api/queryDabhClxx?dabh='+this.clxx.dabh,
                    contentType: "application/json; charset=UTF-8",
                    type: "GET",
                    dataType: 'json',
                    queryParamsType: "",
                    singleSelect: true,
                    paginationShowPageGo: true,
                    pageNumber:1,
                    pageSize:8,
                    queryParams: function (params) {
                        return {'pageNum':params.pageNumber,'pageSize':params.pageSize};
                    },
                    striped: true,
                    smartDisplay:false,
                    cache: false,
                    pagination: false,
                    pageList: [8],
                    sidePagination: 'server',
                    toolbar: "#addtool",
                    columns: [
                        {
                            title: '文件序号',
                            field:'wjxh',
                            formatter:paramsMatter
                        },{
                            field: 'clmc',
                            title: '材料名称',
                            formatter:paramsMatter
                        },
                        {
                            title: '起始页码',
                            field:'qsym',
                            formatter:paramsMatter
                        },{
                            field: 'zzym',
                            title: '终止页码',
                            formatter:paramsMatter
                        },{
                            field: 'ys',
                            title: '页数',
                            formatter:paramsMatter
                        },{
                            title: '操作',
                            formatter: function (value, row, index) {
                                var aStr = '<a class="czBtn" href="javascript:edit(\''+row.dabh+'\','+row.id+')">编辑</a>';
                                aStr += '<a class="czBtn" href="javascript:sccl('+row.id+')">删除</a>';
                                return aStr;
                            }
                        }
                    ],
                    responseHandler: function (res) {  //后台返回的结果
                        if (res.code == "200") {
                            var data = res.data;
                            var NewData = [];
                            for(i=0;i<data.length;i++){
                                var dd = data[i];
                                NewData.push(dd);
                            }
                            var data = {
                                total: res.data.total,
                                rows: NewData
                            };
                            return data;
                        }
                    }
                });
            },
            cldabhChange:function(){
                this.wsxx.dabh = this.clxx.dabh;
                var bh = this.clxx.dabh;
                var datas = bh.split("-");
                var code = datas[0];
                code = datas[0].substring(0,code.length-4)
                this.$http.get('/dagl/api/queryCode?code='+code).then( function (result) {
                    var data = result.body;
                    if (data.code == 200) {
                        if(data.data.sfws != 3){
                            cxAlert("请输入文书档案编号");
                            $("form").data('bootstrapValidator').resetForm();//清除当前验证的关键之处
                        }else {
                            this.parentLx = data.data.id;
                            this.dalx = data.data.id;
                            this.dalxText = data.data.dalxName;
                            this.clxx.typeId = data.data.id;
                            typeId = this.clxx.typeId;
                            this.clxx.typeName = data.data.dalxName;
                            this.wsxx.typeName = data.data.dalxName;
                        }
                    }else{

                    }
                });
                $("#clTable").bootstrapTable('destroy');
                $('#clTable').bootstrapTable({
                    url: '/dalr/api/queryDabhClxx?dabh='+this.clxx.dabh,
                    contentType: "application/json; charset=UTF-8",
                    type: "GET",
                    dataType: 'json',
                    queryParamsType: "",
                    singleSelect: true,
                    paginationShowPageGo: true,
                    pageNumber:1,
                    pageSize:8,
                    queryParams: function (params) {
                        return {'pageNum':params.pageNumber,'pageSize':params.pageSize};
                    },
                    striped: true,
                    smartDisplay:false,
                    cache: false,
                    pagination: false,
                    pageList: [8],
                    sidePagination: 'server',
                    toolbar: "#addtool",
                    columns: [
                        {
                            title: '文件序号',
                            field:'wjxh',
                            formatter:paramsMatter
                        },{
                            field: 'clmc',
                            title: '材料名称',
                            formatter:paramsMatter
                        },
                        {
                            title: '起始页码',
                            field:'qsym',
                            formatter:paramsMatter
                        },{
                            field: 'zzym',
                            title: '终止页码',
                            formatter:paramsMatter
                        },{
                            field: 'ys',
                            title: '页数',
                            formatter:paramsMatter
                        },{
                            title: '操作',
                            formatter: function (value, row, index) {
                                var aStr = '<a class="czBtn" href="javascript:edit(\''+row.dabh+'\','+row.id+')">编辑</a>';
                                aStr += '<a class="czBtn" href="javascript:sccl('+row.id+')">删除</a>';
                                return aStr;
                            }
                        }
                    ],
                    responseHandler: function (res) {  //后台返回的结果
                        if (res.code == "200") {
                            var data = res.data;
                            var NewData = [];
                            for(i=0;i<data.length;i++){
                                var dd = data[i];
                                NewData.push(dd);
                            }
                            var data = {
                                total: res.data.total,
                                rows: NewData
                            };
                            return data;
                        }
                    }
                });
            },
            //导出
            dccl:function(){
                if(this.clxx.dabh == null){
                    cxAlert("档案编号不能为空")
                }else {
                    var url = '/dalr/api/outClxxExcel?dabh='+this.clxx.dabh;
                    window.open(url);
                }
            },
            //刷新
            refreshda:function () {
                if(this.wsxx.dabh == null){
                    cxAlert("请先输入档案编号");
                    return;
                }
                if(!this.isRefresh){
                    cxAlert("档案编号已存在或不是文书档案");
                    return;
                }
                $.get("/dalr/api/queryRgDaxx?dabh=" + this.wsxx.dabh, function (result) {
                    if (result.code == 200) {
                        var data = result.data;
                        var lxNodes = data.lxNodes;
                        kdLxNodes = data.lxNodes;
                        if(data.lxNodes[0].nodes == null){
                            $('#tree').treeview({
                                color: "#428bca",
                                collapseIcon: "glyphicon glyphicon-minus",//可收缩的节点图标
                                // nodeIcon: "glyphicon glyphicon-user",
                                emptyIcon: "glyphicon glyphicon-folder-open",//设置列表树中没有子节点的节点的图标
                                expandIcon: "glyphicon glyphicon-plus",  //设置列表上中有子节点的图标
                                highlightSearchResults: true,//是否高亮搜索结果 默认true
                                highlightSelected: true,     //是否选中高亮显示
                                onhoverColor: "#f5f5f5",    //鼠标滑过的颜色
                                levels: 0 ,// 设置初始化展开几级菜单 默认为2
                                showBorder: true,                //是否显示边框
                                data: data.lxNodes,
                                //showCheckbox: true,
                                multiSelect: false,
                                // onNodeChecked: nodeChecked,
                                // onNodeUnchecked: nodeUnchecked,
                                onNodeSelected: function (event, data) {
                                    var id = data.id;
                                    kdid = data.id;
                                    id = decodeURIComponent(id);
                                    id =  id.toLowerCase();
                                    if(id.indexOf(".png")!=-1|| id.indexOf(".jpg")!=-1){
                                        $('#tree2Img').attr('dataUrl', '/jy/api/getImg?path='+data.id+'&jyId='+Id);
                                        viewer2 = new Viewer(document.getElementById('tree2'), {
                                            inline: true,
                                            url: 'dataUrl',
                                            //navbar: false,
                                            zIndexInline: 9999,
                                            button: true,
                                            backdrop: true,
                                            navbar:false,
                                            fullscreen:false,
                                            toolbar: {
                                                zoomIn: {
                                                    show: 1,
                                                    click: function () {
                                                        viewer2.destroy();
                                                    }
                                                },
                                                zoomOut: 0,
                                                oneToOne: 0,
                                                reset: 0,
                                                prev: {
                                                    show:1,
                                                    click: function(){
                                                        viewer2.destroy();
                                                        openpre(lxNodes,data.id,Id,2)
                                                    }

                                                },
                                                next: {
                                                    show:1,
                                                    click: function(){
                                                        viewer2.destroy();
                                                        opennext(lxNodes,data.id,Id,2)
                                                    }

                                                },
                                                rotateLeft: 1,
                                                rotateRight: 1,
                                                flipHorizontal: 0,
                                                flipVertical: 0,
                                            },
                                        });
                                    }else if(id.indexOf(".pdf")!=-1){
                                        var u = "/jy/api/getPdf/"+id+"/"+Id;
                                        top.addTabs({
                                            id: "63233",
                                            text: "PDF浏览器",
                                            icon: "fa fa-circle-o",
                                            url: "/static/pdf/web/viewer.html?file="+u,
                                            targetType: "iframe-tab",
                                            close:true
                                        });
                                    }

                                }
                            });
                        }else {
                            $('#tree').treeview({
                                color: "#428bca",
                                collapseIcon: "glyphicon glyphicon-minus",//可收缩的节点图标
                                // nodeIcon: "glyphicon glyphicon-user",
                                emptyIcon: "glyphicon glyphicon-file",//设置列表树中没有子节点的节点的图标
                                expandIcon: "glyphicon glyphicon-plus",  //设置列表上中有子节点的图标
                                highlightSearchResults: true,//是否高亮搜索结果 默认true
                                highlightSelected: true,     //是否选中高亮显示
                                onhoverColor: "#f5f5f5",    //鼠标滑过的颜色
                                levels: 0 ,// 设置初始化展开几级菜单 默认为2
                                showBorder: true,                //是否显示边框
                                data: data.lxNodes,
                                //showCheckbox: true,
                                multiSelect: false,
                                // onNodeChecked: nodeChecked,
                                // onNodeUnchecked: nodeUnchecked,
                                onNodeSelected: function (event, data) {
                                    var id = data.id;
                                    kdid = data.id;
                                    id = decodeURIComponent(id);
                                    id =  id.toLowerCase();
                                    if(id.indexOf(".png")!=-1|| id.indexOf(".jpg")!=-1){
                                        $('#tree2Img').attr('dataUrl', '/jy/api/getImg?path='+data.id+'&jyId='+Id);
                                        viewer2 = new Viewer(document.getElementById('tree2'), {
                                            inline: true,
                                            url: 'dataUrl',
                                            //navbar: false,
                                            zIndexInline: 9999,
                                            button: true,
                                            backdrop: true,
                                            navbar:false,
                                            fullscreen:false,
                                            toolbar: {
                                                zoomIn: {
                                                    show: 1,
                                                    click: function () {
                                                        viewer2.destroy();
                                                    }
                                                },
                                                zoomOut: 0,
                                                oneToOne: 0,
                                                reset: 0,
                                                prev: {
                                                    show:1,
                                                    click: function(){
                                                        viewer2.destroy();
                                                        openpre(lxNodes,data.id,Id,2)
                                                    }

                                                },
                                                next: {
                                                    show:1,
                                                    click: function(){
                                                        viewer2.destroy();
                                                        opennext(lxNodes,data.id,Id,2)
                                                    }

                                                },
                                                rotateLeft: 1,
                                                rotateRight: 1,
                                                flipHorizontal: 0,
                                                flipVertical: 0,
                                            },
                                        });
                                    }else if(id.indexOf(".pdf")!=-1){
                                        var u = "/jy/api/getPdf/"+id+"/"+Id;
                                        top.addTabs({
                                            id: "63233",
                                            text: "PDF浏览器",
                                            icon: "fa fa-circle-o",
                                            url: "/static/pdf/web/viewer.html?file="+u,
                                            targetType: "iframe-tab",
                                            close:true
                                        });
                                    }

                                }
                            });
                        }
                    }else{
                        cxAlert(result.mess)
                    }
                });
            },
            mySubmit2:function () {
                dabh = this.clxx.dabh;
                dalx = this.dalxText;
                //this.clxx.typeName = dalx;
                //this.clxx.typeId = typeId;
                var bootstrapValidator1 = $("#clxxForm").data('bootstrapValidator');
                bootstrapValidator1.validate();
                if(bootstrapValidator1.isValid()){
                    var bh = this.clxx.dabh;
                    var datas = bh.split("-");
                    var code = datas[0];
                    code = datas[0].substring(0,code.length-4)
                    this.$http.get('/dagl/api/queryCode?code='+code).then( function (result) {
                        var data = result.body;
                        if (data.code == 200) {
                            if(data.data.sfws != 3){
                                cxAlert("请输入文书档案编号");
                                $("form").data('bootstrapValidator').resetForm();//清除当前验证的关键之处
                            }else {
                                this.zzmySubmit2 = true;
                                var myMsg = cxLoad("上传中");
                                this.$http.post('/dalr/api/clbr',this.clxx).then( function (result) {
                                    var data = result.body;
                                    if(data.code == 200){
                                        this.zzmySubmit2 = false;
                                        layer.close(myMsg);
                                        typeName = this.clxx.typeName;
                                        typeId = this.clxx.typeId;
                                        cxAlertOk("提交成功");
                                        $("#clxxForm").data('bootstrapValidator').resetForm();//清除当前验证的关键之处
                                        Object.keys(this.clxx).forEach(key => (this.clxx[key] = null));
                                        this.parentLx=null;
                                        //this.dalx=null;
                                        this.clxx.dabh = dabh;
                                        this.clxx.typeName = typeName;
                                        this.clxx.typeId = typeId;
                                        $("#clTable").bootstrapTable('destroy');
                                        $('#clTable').bootstrapTable({
                                            url: '/dalr/api/queryDabhClxx?dabh='+vue.$data.clxx.dabh,
                                            contentType: "application/json; charset=UTF-8",
                                            type: "GET",
                                            dataType: 'json',
                                            queryParamsType: "",
                                            singleSelect: true,
                                            paginationShowPageGo: true,
                                            pageNumber:1,
                                            pageSize:8,
                                            queryParams: function (params) {
                                                return {'pageNum':params.pageNumber,'pageSize':params.pageSize};
                                            },
                                            striped: true,
                                            smartDisplay:false,
                                            cache: false,
                                            pagination: false,
                                            pageList: [8],
                                            sidePagination: 'server',
                                            toolbar: "#addtool",
                                            columns: [
                                                {
                                                    title: '文件序号',
                                                    field:'wjxh',
                                                    formatter:paramsMatter
                                                },{
                                                    field: 'clmc',
                                                    title: '材料名称',
                                                    formatter:paramsMatter
                                                },
                                                {
                                                    title: '起始页码',
                                                    field:'qsym',
                                                    formatter:paramsMatter
                                                },{
                                                    field: 'zzym',
                                                    title: '终止页码',
                                                    formatter:paramsMatter
                                                },{
                                                    field: 'ys',
                                                    title: '页数',
                                                    formatter:paramsMatter
                                                },{
                                                    title: '操作',
                                                    formatter: function (value, row, index) {
                                                        var aStr = '<a class="czBtn" href="javascript:edit(\''+row.dabh+'\','+row.id+')">编辑</a>';
                                                        aStr += '<a class="czBtn" href="javascript:sccl('+row.id+')">删除</a>';
                                                        return aStr;
                                                    }
                                                }
                                            ],
                                            responseHandler: function (res) {  //后台返回的结果
                                                if (res.code == "200") {
                                                    var data = res.data;
                                                    var NewData = [];
                                                    for(i=0;i<data.length;i++){
                                                        var dd = data[i];
                                                        NewData.push(dd);
                                                    }
                                                    var data = {
                                                        total: res.data.total,
                                                        rows: NewData
                                                    };
                                                    return data;
                                                }
                                            }
                                        });
                                        //this.dalxText=null;
                                        //top.refreshTab();
                                    }else{
                                        layer.close(myMsg);
                                        this.zzmySubmit2 = false;
                                        cxAlert(data.mess);
                                        dabh = this.clxx.dabh;
                                        $("#clxxForm").data('bootstrapValidator').resetForm();//清除当前验证的关键之处
                                        Object.keys(this.clxx).forEach(key => (this.clxx[key] = null));
                                        this.parentLx=null;
                                        this.dalx=null;
                                        this.clxx.dabh = dabh;
                                        this.clxx.typeName = typeName;
                                        this.clxx.typeId = typeId;
                                    }
                                })
                            }
                        }else{

                        }
                    });

                }
            },
            daxxlr:function(){
                this.daShow = true;
                this.clShow = false;
                document.getElementById('daxxtab').className = 'lrtabs';
                document.getElementById('clxxtab').className = '';
                document.getElementById('daxxtab2').className = 'lrtabs';
                document.getElementById('clxxtab2').className = '';
            },
            clxxlr:function(){
                if(this.wsxx.dabh == null){
                    cxAlert("请先填写档案编号")
                    return;
                }else {
                    this.daShow = false;
                    this.clShow = true;
                    document.getElementById('daxxtab2').className = '';
                    document.getElementById('clxxtab2').className = 'lrtabs';
                    this.clxx.dabh = this.gdxx.dabh;
                    $("#clTable").bootstrapTable('destroy');
                    $('#clTable').bootstrapTable({
                        url: '/dalr/api/queryDabhClxx?dabh='+this.clxx.dabh,
                        contentType: "application/json; charset=UTF-8",
                        type: "GET",
                        dataType: 'json',
                        queryParamsType: "",
                        singleSelect: true,
                        paginationShowPageGo: true,
                        pageNumber:1,
                        pageSize:8,
                        queryParams: function (params) {
                            return {'pageNum':params.pageNumber,'pageSize':params.pageSize};
                        },
                        striped: true,
                        smartDisplay:false,
                        cache: false,
                        pagination: false,
                        pageList: [8],
                        sidePagination: 'server',
                        toolbar: "#addtool",
                        columns: [
                            {
                                title: '文件序号',
                                field:'wjxh',
                                formatter:paramsMatter
                            },{
                                field: 'clmc',
                                title: '材料名称',
                                formatter:paramsMatter
                            },
                            {
                                title: '起始页码',
                                field:'qsym',
                                formatter:paramsMatter
                            },{
                                field: 'zzym',
                                title: '终止页码',
                                formatter:paramsMatter
                            },{
                                field: 'ys',
                                title: '页数',
                                formatter:paramsMatter
                            },{
                                title: '操作',
                                formatter: function (value, row, index) {
                                    var aStr = '<a class="czBtn" href="javascript:edit(\''+row.dabh+'\','+row.id+')">编辑</a>';
                                    aStr += '<a class="czBtn" href="javascript:sccl('+row.id+')">删除</a>';
                                    return aStr;
                                }
                            }
                        ],
                        responseHandler: function (res) {  //后台返回的结果
                            if (res.code == "200") {
                                var data = res.data;
                                var NewData = [];
                                for(i=0;i<data.length;i++){
                                    var dd = data[i];
                                    NewData.push(dd);
                                }
                                var data = {
                                    total: res.data.total,
                                    rows: NewData
                                };
                                return data;
                            }
                        }
                    });
                }
            },
            upload:function(){
                $('#daclscModal').modal('show');
            },
            sureLxSelect:function(){
                $('#lxxzModal').modal('hide');
            },
            wsdabhChange:function(){
                var bh2 = this.wsxx.dabh;
                this.clxx.dabh = this.wsxx.dabh;
                var datas2 = bh2.split("-");
                var code2 = datas2[0];
                code2 = datas2[0].substring(0,code2.length-4)
                this.$http.get('/dagl/api/queryCode?code='+code2).then( function (result) {
                    var data = result.body;
                    if (data.code == 200) {
                        if(data.data.sfws != 3){
                            this.isRefresh = false;
                            cxAlert("请输入文书编号");
                            $("#wsxxForm").data('bootstrapValidator').resetForm();//清除当前验证的关键之处
                        }else{
                            this.isRefresh = true;
                            this.wsxx.dalxText = data.data.dalxName;
                            //this.wsxx.id = data.data.id;
                            this.wsxx.typeName = data.data.dalxName;
                            this.wsxx.typeId = data.data.id;
                            this.dalxText = data.data.dalxName;
                            //this.wsxx.id = data.data.id;
                            this.clxx.typeName = data.data.dalxName;
                            this.clxx.typeId = data.data.id;
                            //this.clxx.dabh = data.data.dabh;
                            this.$http.get('/dalr/api/dasf?dabh='+bh2).then( function (result) {
                                var data = result.body;
                                if (data.code == 200) {
                                    this.isRefresh = true;
                                }else{
                                    this.isRefresh = false;
                                    cxAlert("该编号已经录入");
                                }
                            });
                        }
                    }else{
                        cxAlert("该编号不符合要求");
                        this.wsxx.dabh = null;
                        $("#wsxxForm").data('bootstrapValidator').resetForm();//清除当前验证的关键之处
                    }
                });
            },
            mySubmitws:function () {
                var data = new FormData();
                var bootstrapValidator2 = $("#wsxxForm").data('bootstrapValidator');
                bootstrapValidator2.validate();
                if(bootstrapValidator2.isValid()){
                    var bh = this.wsxx.dabh;
                    var datas = bh.split("-");
                    var code = datas[0];
                    code = datas[0].substring(0,code.length-4)
                    this.$http.get('/dagl/api/queryCode?code='+code).then( function (result) {
                        var data = result.body;
                        if (data.code == 200) {
                            if(data.data.sfws != 3){
                                cxAlert("请输入文书编号");
                            }else{
                                this.zzmySubmitws = true;
                                var myMsg = cxLoad("上传中");
                                this.$http.post('/dalr/api/dabrWs',this.wsxx).then( function (result) {
                                    this.zzmySubmitws = false;
                                    var data = result.body;
                                    if (data.code == 200) {
                                        cxAlertOk("录入成功");
                                        layer.close(myMsg);
                                        vue.$data.wstj = false;
                                        vue.$data.wslr = true;
                                        $("#wsxxForm").data('bootstrapValidator').resetForm();//清除当前验证的关键之处
                                        $.get("/dalr/api/queryRgDaxx?dabh=" + this.wsxx.dabh, function (result) {
                                            if (result.code == 200) {
                                                var data = result.data;
                                                var lxNodes = data.lxNodes;
                                                kdLxNodes = data.lxNodes;
                                                if(data.lxNodes[0].nodes == null){
                                                    $('#tree').treeview({
                                                        color: "#428bca",
                                                        collapseIcon: "glyphicon glyphicon-minus",//可收缩的节点图标
                                                        // nodeIcon: "glyphicon glyphicon-user",
                                                        emptyIcon: "glyphicon glyphicon-folder-open",//设置列表树中没有子节点的节点的图标
                                                        expandIcon: "glyphicon glyphicon-plus",  //设置列表上中有子节点的图标
                                                        highlightSearchResults: true,//是否高亮搜索结果 默认true
                                                        highlightSelected: true,     //是否选中高亮显示
                                                        onhoverColor: "#f5f5f5",    //鼠标滑过的颜色
                                                        levels: 0 ,// 设置初始化展开几级菜单 默认为2
                                                        showBorder: true,                //是否显示边框
                                                        data: data.lxNodes,
                                                        //showCheckbox: true,
                                                        multiSelect: false,
                                                        // onNodeChecked: nodeChecked,
                                                        // onNodeUnchecked: nodeUnchecked,
                                                        onNodeSelected: function (event, data) {
                                                            var id = data.id;
                                                            kdid = data.id;
                                                            id = decodeURIComponent(id);
                                                            id =  id.toLowerCase();
                                                            if(id.indexOf(".png")!=-1|| id.indexOf(".jpg")!=-1){
                                                                $('#tree2Img').attr('dataUrl', '/jy/api/getImg?path='+data.id+'&jyId='+Id);
                                                                viewer2 = new Viewer(document.getElementById('tree2'), {
                                                                    inline: true,
                                                                    url: 'dataUrl',
                                                                    //navbar: false,
                                                                    zIndexInline: 9999,
                                                                    button: true,
                                                                    backdrop: true,
                                                                    navbar:false,
                                                                    fullscreen:false,
                                                                    toolbar: {
                                                                        zoomIn: {
                                                                            show: 1,
                                                                            click: function () {
                                                                                viewer2.destroy();
                                                                            }
                                                                        },
                                                                        zoomOut: 0,
                                                                        oneToOne: 0,
                                                                        reset: 0,
                                                                        prev: {
                                                                            show:1,
                                                                            click: function(){
                                                                                viewer2.destroy();
                                                                                openpre(lxNodes,data.id,Id,2)
                                                                            }

                                                                        },
                                                                        next: {
                                                                            show:1,
                                                                            click: function(){
                                                                                viewer2.destroy();
                                                                                opennext(lxNodes,data.id,Id,2)
                                                                            }

                                                                        },
                                                                        rotateLeft: 1,
                                                                        rotateRight: 1,
                                                                        flipHorizontal: 0,
                                                                        flipVertical: 0,
                                                                    },
                                                                });
                                                            }else if(id.indexOf(".pdf")!=-1){
                                                                var u = "/jy/api/getPdf/"+id+"/"+Id;
                                                                top.addTabs({
                                                                    id: "63233",
                                                                    text: "PDF浏览器",
                                                                    icon: "fa fa-circle-o",
                                                                    url: "/static/pdf/web/viewer.html?file="+u,
                                                                    targetType: "iframe-tab",
                                                                    close:true
                                                                });
                                                            }

                                                        }
                                                    });
                                                }else {
                                                    $('#tree').treeview({
                                                        color: "#428bca",
                                                        collapseIcon: "glyphicon glyphicon-minus",//可收缩的节点图标
                                                        // nodeIcon: "glyphicon glyphicon-user",
                                                        emptyIcon: "glyphicon glyphicon-file",//设置列表树中没有子节点的节点的图标
                                                        expandIcon: "glyphicon glyphicon-plus",  //设置列表上中有子节点的图标
                                                        highlightSearchResults: true,//是否高亮搜索结果 默认true
                                                        highlightSelected: true,     //是否选中高亮显示
                                                        onhoverColor: "#f5f5f5",    //鼠标滑过的颜色
                                                        levels: 0 ,// 设置初始化展开几级菜单 默认为2
                                                        showBorder: true,                //是否显示边框
                                                        data: data.lxNodes,
                                                        //showCheckbox: true,
                                                        multiSelect: false,
                                                        // onNodeChecked: nodeChecked,
                                                        // onNodeUnchecked: nodeUnchecked,
                                                        onNodeSelected: function (event, data) {
                                                            var id = data.id;
                                                            kdid = data.id;
                                                            id = decodeURIComponent(id);
                                                            id =  id.toLowerCase();
                                                            if(id.indexOf(".png")!=-1|| id.indexOf(".jpg")!=-1){
                                                                $('#tree2Img').attr('dataUrl', '/jy/api/getImg?path='+data.id+'&jyId='+Id);
                                                                viewer2 = new Viewer(document.getElementById('tree2'), {
                                                                    inline: true,
                                                                    url: 'dataUrl',
                                                                    //navbar: false,
                                                                    zIndexInline: 9999,
                                                                    button: true,
                                                                    backdrop: true,
                                                                    navbar:false,
                                                                    fullscreen:false,
                                                                    toolbar: {
                                                                        zoomIn: {
                                                                            show: 1,
                                                                            click: function () {
                                                                                viewer2.destroy();
                                                                            }
                                                                        },
                                                                        zoomOut: 0,
                                                                        oneToOne: 0,
                                                                        reset: 0,
                                                                        prev: {
                                                                            show:1,
                                                                            click: function(){
                                                                                viewer2.destroy();
                                                                                openpre(lxNodes,data.id,Id,2)
                                                                            }

                                                                        },
                                                                        next: {
                                                                            show:1,
                                                                            click: function(){
                                                                                viewer2.destroy();
                                                                                opennext(lxNodes,data.id,Id,2)
                                                                            }

                                                                        },
                                                                        rotateLeft: 1,
                                                                        rotateRight: 1,
                                                                        flipHorizontal: 0,
                                                                        flipVertical: 0,
                                                                    },
                                                                });
                                                            }else if(id.indexOf(".pdf")!=-1){
                                                                var u = "/jy/api/getPdf/"+id+"/"+Id;
                                                                top.addTabs({
                                                                    id: "63233",
                                                                    text: "PDF浏览器",
                                                                    icon: "fa fa-circle-o",
                                                                    url: "/static/pdf/web/viewer.html?file="+u,
                                                                    targetType: "iframe-tab",
                                                                    close:true
                                                                });
                                                            }

                                                        }
                                                    });
                                                }
                                            }else{
                                                cxAlert(result.mess)
                                            }
                                        });
                                    }else{
                                        layer.close(myMsg);
                                        cxAlert(data.mess);
                                        $("#wsxxForm").data('bootstrapValidator').resetForm();//清除当前验证的关键之处
                                    }
                                });
                            }
                        }
                    });
                }
            },
        },
        created: function () {
            $.get('/getUser').then( function (result) {
                var data = result.data;
                if(result.code == 200){
                    vue.$data.role = data.roleId;
                    vue.$data.wsxx.djr = data.name;
                }
            });
            this.$http.get('/listShUser').then( function (result) {
                var data = result.body;
                if(data.code == 200){
                    this.allShy = data.data;
                }else{
                    cxAlert(data.mess);
                }
            })
        },
        mounted: function () {
            try {
                top.activeTabByPageId(90023);
                top.closeTabByPageId(90023);
                top.activeTabByPageId(19001116);
            }catch (e) {
                top.activeTabByPageId(19001116);
            }
            var that = this;
            var url = location.search;
            var type = '';
            if(url !== ""){
                var dabh = url.substring(0,url.indexOf('&'));
                dabh = dabh.substring(dabh.indexOf('=')+1);
                var url2 = url.substring(url.indexOf('&')+1);
                type = url2.substring(0,url2.indexOf('&'));
                type = type.substring(type.indexOf('=')+1);
                var url3 = url2.substring(url2.indexOf('&')+1);
                var id = url3.substring(0,url3.indexOf('&'));
                id = id.substring(id.indexOf('=')+1);
                var url4 = url3.substring(url3.indexOf('&')+1);
                pageNum = url4.substring(0,url4.indexOf('&'));
                pageNum = pageNum.substring(pageNum.indexOf('=')+1);
                var url5 = url4.substring(url4.indexOf('&')+1);
                pageSize = url5.substring(url5.indexOf('=')+1);
                that.isRefresh = true;
                that.readOnlyDabh = true;
            }
            //Id = id;
            if(type != '' && type == 0){
                that.clxx.dabh = dabh;
                that.wsxx.dabh = dabh;
                that.daShow = false;
                that.clShow = true;
                document.getElementById('daxxtab2').className = '';
                document.getElementById('clxxtab2').className = 'lrtabs';
                var bh = dabh;
                var datas = bh.split("-");
                var code = datas[0];
                code = datas[0].substring(0,code.length-4)
                this.$http.get('/dagl/api/queryCode?code='+code).then( function (result) {
                    var data = result.body;
                    if (data.code == 200) {
                        if(data.data.sfws != 3){
                            cxAlert("请输入文书编号");
                        }else{
                            this.wsxx.dalxText = data.data.dalxName;
                            dalx = this.wsxx.dalxText;
                            this.parentLx = data.data.id;
                            this.dalxText = data.data.dalxName;
                            this.wsxx.typeId = data.data.id;
                            this.clxx.typeId = data.data.id;
                        }
                    }
                });
                $.get("/dalr/api/queryRgDaxx?dabh=" + dabh, function (result) {
                    if (result.code == 200) {
                        var data = result.data;
                        var lxNodes = data.lxNodes;
                        kdLxNodes = data.lxNodes;
                         vue.$data.wsxx = data.daxxWsRg;
                        if(data.lxNodes[0].nodes == null){
                            $('#tree').treeview({
                                color: "#428bca",
                                collapseIcon: "glyphicon glyphicon-minus",//可收缩的节点图标
                                // nodeIcon: "glyphicon glyphicon-user",
                                emptyIcon: "glyphicon glyphicon-folder-open",//设置列表树中没有子节点的节点的图标
                                expandIcon: "glyphicon glyphicon-plus",  //设置列表上中有子节点的图标
                                highlightSearchResults: true,//是否高亮搜索结果 默认true
                                highlightSelected: true,     //是否选中高亮显示
                                onhoverColor: "#f5f5f5",    //鼠标滑过的颜色
                                levels: 0 ,// 设置初始化展开几级菜单 默认为2
                                showBorder: true,                //是否显示边框
                                data: data.lxNodes,
                                //showCheckbox: true,
                                multiSelect: false,
                                // onNodeChecked: nodeChecked,
                                // onNodeUnchecked: nodeUnchecked,
                                onNodeSelected: function (event, data) {
                                    var id = data.id;
                                    kdid = data.id;
                                    id = decodeURIComponent(id);
                                    id =  id.toLowerCase();
                                    if(id.indexOf(".png")!=-1|| id.indexOf(".jpg")!=-1){
                                        $('#tree2Img').attr('dataUrl', '/jy/api/getImg?path='+data.id+'&jyId='+Id);
                                        viewer2 = new Viewer(document.getElementById('tree2'), {
                                            inline: true,
                                            url: 'dataUrl',
                                            //navbar: false,
                                            zIndexInline: 9999,
                                            button: true,
                                            backdrop: true,
                                            navbar:false,
                                            fullscreen:false,
                                            toolbar: {
                                                zoomIn: {
                                                    show: 1,
                                                    click: function () {
                                                        viewer2.destroy();
                                                    }
                                                },
                                                zoomOut: 0,
                                                oneToOne: 0,
                                                reset: 0,
                                                prev: {
                                                    show:1,
                                                    click: function(){
                                                        viewer2.destroy();
                                                        openpre(lxNodes,data.id,Id,2)
                                                    }

                                                },
                                                next: {
                                                    show:1,
                                                    click: function(){
                                                        viewer2.destroy();
                                                        opennext(lxNodes,data.id,Id,2)
                                                    }

                                                },
                                                rotateLeft: 1,
                                                rotateRight: 1,
                                                flipHorizontal: 0,
                                                flipVertical: 0,
                                            },
                                        });
                                    }else if(id.indexOf(".pdf")!=-1){
                                        var u = "/jy/api/getPdf/"+id+"/"+Id;
                                        top.addTabs({
                                            id: "63233",
                                            text: "PDF浏览器",
                                            icon: "fa fa-circle-o",
                                            url: "/static/pdf/web/viewer.html?file="+u,
                                            targetType: "iframe-tab",
                                            close:true
                                        });
                                    }

                                }
                            });
                        }else {
                            $('#tree').treeview({
                                color: "#428bca",
                                collapseIcon: "glyphicon glyphicon-minus",//可收缩的节点图标
                                // nodeIcon: "glyphicon glyphicon-user",
                                emptyIcon: "glyphicon glyphicon-file",//设置列表树中没有子节点的节点的图标
                                expandIcon: "glyphicon glyphicon-plus",  //设置列表上中有子节点的图标
                                highlightSearchResults: true,//是否高亮搜索结果 默认true
                                highlightSelected: true,     //是否选中高亮显示
                                onhoverColor: "#f5f5f5",    //鼠标滑过的颜色
                                levels: 0 ,// 设置初始化展开几级菜单 默认为2
                                showBorder: true,                //是否显示边框
                                data: data.lxNodes,
                                //showCheckbox: true,
                                multiSelect: false,
                                // onNodeChecked: nodeChecked,
                                // onNodeUnchecked: nodeUnchecked,
                                onNodeSelected: function (event, data) {
                                    var id = data.id;
                                    kdid = data.id;
                                    id = decodeURIComponent(id);
                                    id =  id.toLowerCase();
                                    if(id.indexOf(".png")!=-1|| id.indexOf(".jpg")!=-1){
                                        $('#tree2Img').attr('dataUrl', '/jy/api/getImg?path='+data.id+'&jyId='+Id);
                                        viewer2 = new Viewer(document.getElementById('tree2'), {
                                            inline: true,
                                            url: 'dataUrl',
                                            //navbar: false,
                                            zIndexInline: 9999,
                                            button: true,
                                            backdrop: true,
                                            navbar:false,
                                            fullscreen:false,
                                            toolbar: {
                                                zoomIn: {
                                                    show: 1,
                                                    click: function () {
                                                        viewer2.destroy();
                                                    }
                                                },
                                                zoomOut: 0,
                                                oneToOne: 0,
                                                reset: 0,
                                                prev: {
                                                    show:1,
                                                    click: function(){
                                                        viewer2.destroy();
                                                        openpre(lxNodes,data.id,Id,2)
                                                    }

                                                },
                                                next: {
                                                    show:1,
                                                    click: function(){
                                                        viewer2.destroy();
                                                        opennext(lxNodes,data.id,Id,2)
                                                    }

                                                },
                                                rotateLeft: 1,
                                                rotateRight: 1,
                                                flipHorizontal: 0,
                                                flipVertical: 0,
                                            },
                                        });
                                    }else if(id.indexOf(".pdf")!=-1){
                                        var u = "/jy/api/getPdf/"+id+"/"+Id;
                                        top.addTabs({
                                            id: "63233",
                                            text: "PDF浏览器",
                                            icon: "fa fa-circle-o",
                                            url: "/static/pdf/web/viewer.html?file="+u,
                                            targetType: "iframe-tab",
                                            close:true
                                        });
                                    }

                                }
                            });
                        }
                    }else{
                        cxAlert(result.mess)
                    }
                });
            }else {
                this.$http.get('/dalr/api/getinputtime').then(function (res) {
                    var data = res.body;
                    if(data.code == 200){
                        that.$data.wsxx.inputtime = data.data;
                    }
                });
            }
            this.$http.get('/dagl/api/queryDalx').then( function (result) {
                var data = result.body;
                if(data.code == 200){
                    getkjAndws(data.data);
                    that.zt = that.kj;
                    that.jyxx2.dalx = that.dalx;
                }else{
                    cxAlert(data.mess);
                }
            });

            $("#clTable").bootstrapTable('destroy');
            $('#clTable').bootstrapTable({
                url: '/dalr/api/queryDabhClxx?dabh='+that.clxx.dabh,
                contentType: "application/json; charset=UTF-8",
                type: "GET",
                dataType: 'json',
                queryParamsType: "",
                singleSelect: true,
                paginationShowPageGo: true,
                pageNumber:1,
                pageSize:8,
                queryParams: function (params) {
                    return {'pageNum':params.pageNumber,'pageSize':params.pageSize};
                },
                striped: true,
                smartDisplay:false,
                cache: false,
                pagination: false,
                pageList: [8],
                sidePagination: 'server',
                toolbar: "#addtool",
                columns: [
                    {
                        title: '文件序号',
                        field:'wjxh',
                        formatter:paramsMatter
                    },{
                        field: 'clmc',
                        title: '材料名称',
                        formatter:paramsMatter
                    },
                    {
                        title: '起始页码',
                        field:'qsym',
                        formatter:paramsMatter
                    },{
                        field: 'zzym',
                        title: '终止页码',
                        formatter:paramsMatter
                    },{
                        field: 'ys',
                        title: '页数',
                        formatter:paramsMatter
                    },{
                        title: '操作',
                        formatter: function (value, row, index) {
                            var aStr = '<a class="czBtn" href="javascript:edit(\''+row.dabh+'\','+row.id+')">编辑</a>';
                            aStr += '<a class="czBtn" href="javascript:sccl('+row.id+')">删除</a>';
                            return aStr;
                        }
                    }
                ],
                responseHandler: function (res) {  //后台返回的结果
                    if (res.code == "200") {
                        var data = res.data;
                        var NewData = [];
                        for(i=0;i<data.length;i++){
                            var dd = data[i];
                            NewData.push(dd);
                        }
                        var data = {
                            total: res.data.total,
                            rows: NewData
                        };
                        return data;
                    }
                }
            });
            $('#wsxxForm').bootstrapValidator({
                feedbackIcons: {
                    excluded:[":disabled"],
                    valid: 'glyphicon glyphicon-ok',
                    invalid: 'glyphicon glyphicon-remove',
                    validating: 'glyphicon glyphicon-refresh'
                },
                fields: {
                    dalxText: {
                        validators: {
                            notEmpty: {
                                message: '档案类型不能为空'
                            }
                        }
                    },
                    nf: {
                        validators: {
                            notEmpty: {
                                message: '年份不能为空不能为空'
                            },
                            digits: {
                                message: '年份只能包含数字。'
                            },
                            stringLength: {
                                min: 4,
                                max: 4,
                                message: '年份必须为4位数字'
                            }
                        }
                    },
                    yh: {
                        validators: {
                            digits: {
                                message: '页号只能包含数字。'
                            },
                            stringLength: {
                                max: 4,
                                message: '页号字段长度不能超过4位'
                            }
                        }
                    },
                    ys: {
                        validators: {
                            digits: {
                                message: '页数只能包含数字。'
                            },
                            stringLength: {
                                max: 4,
                                message: '页数字段长度不能超过4位'
                            }
                        }
                    },
                    dabh: {
                        validators: {
                            notEmpty: {
                                message: '档案编号不能为空'
                            },
                            stringLength: {
                                max: 150,
                                message: '档案编号字段长度不能超过150位'
                            }
                        }
                    },
                    zhh: {
                        validators: {
                            stringLength: {
                                max: 100,
                                message: '总盒号字段长度不能超过100位'
                            }
                        }
                    },
                    dwmc: {
                        validators: {
                            stringLength: {
                                max: 255,
                                message: '单位名称字段长度不能超过100位'
                            }
                        }
                    },
                    sj: {
                        validators: {
                            stringLength: {
                                max: 20,
                                message: '时间字段长度不能超过20位'
                            }
                        }
                    },
                    wjmc: {
                        validators: {
                            notEmpty: {
                                message: '文件名称不能为空'
                            },
                            stringLength: {
                                max: 255,
                                message: '文件名称字段长度不能超过255位'
                            }
                        }
                    },
                    bz: {
                        validators: {
                            stringLength: {
                                max: 200,
                                message: '备注字段长度不能超过200位'
                            }
                        }
                    },
                    wh: {
                        validators: {
                            stringLength: {
                                max: 200,
                                message: '文号字段长度不能超过200位'
                            }
                        }
                    },
                }
            });
            $('#clxxForm').bootstrapValidator({
                feedbackIcons: {
                    valid: 'glyphicon glyphicon-ok',
                    invalid: 'glyphicon glyphicon-remove',
                    validating: 'glyphicon glyphicon-refresh'
                },
                fields: {
                    dalxText: {
                        validators: {
                            notEmpty: {
                                message: '档案类型不能为空'
                            }
                        }
                    },
                    wjxh: {
                        validators: {
                            notEmpty: {
                                message: '文件序号不能为空'
                            },
                            stringLength: {
                                min: 3,
                                max: 3,
                                message: '文件序号必须为3位数字'
                            }
                        }
                    },
                    year: {
                        validators: {
                            digits: {
                                message: '年份只能包含数字。'
                            },
                            stringLength: {
                                min: 4,
                                max: 4,
                                message: '年份必须为4位数字'
                            }
                        }
                    },
                    ys: {
                        validators: {
                            digits: {
                                message: '页数只能包含数字。'
                            },
                            stringLength: {
                                max: 4,
                                message: '页数字段长度不能超过4'
                            }
                        }
                    },zzym: {
                        validators: {
                            digits: {
                                message: '终止页码只能包含数字。'
                            },
                            stringLength: {
                                max: 4,
                                message: '终止页码字段长度不能超过4'
                            }
                        }
                    },qsym: {
                        validators: {
                            digits: {
                                message: '起始页码只能包含数字。'
                            },
                            stringLength: {
                                max: 4,
                                message: '起始页码字段长度不能超过4'
                            }
                        }
                    },fs: {
                        validators: {
                            digits: {
                                message: '份数只能包含数字。'
                            },
                            stringLength: {
                                max: 11,
                                message: '份数字段长度不能超过11'
                            }
                        }
                    },
                    clmc: {
                        validators: {
                            notEmpty: {
                                message: '材料名称不能为空'
                            },
                            stringLength: {
                                max: 100,
                                message: '材料名称字段长度不能超过100'
                            }
                        }
                    },
                    // wjxh: {
                    //     validators: {
                    //         notEmpty: {
                    //             message: '文件序号不能为空'
                    //         }
                    //     }
                    // },
                    dabh: {
                        validators: {
                            notEmpty: {
                                message: '档案编号不能为空'
                            }
                        }
                    },
                    otherZh: {
                        validators: {
                            stringLength: {
                                max: 50,
                                message: '案卷号/文号/许可证号字段长度不能超过50'
                            }
                        }
                    },
                    bz: {
                        validators: {
                            stringLength: {
                                max: 255,
                                message: '备注字段长度不能超过255'
                            }
                        }
                    },
                    slsj: {
                        validators: {
                            stringLength: {
                                max: 150,
                                message: '受理时间字段长度不能超过150'
                            }
                        }
                    }
                }
            });
        }
    });


</script>

</body>
</html>
